﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using condortravel.operaciones.business.operaciones;
using condortravel.operaciones.business.tour;
using condortravel.operaciones.business.mantenimientoOperaciones;


namespace CondorTravelOperacionesWeb.Pages.TourOperaciones
{
    public partial class FormAsignarRecursos : System.Web.UI.Page
    {
        #region Business Objects

        private TourServices tourServices;

        public TourServices TourServices
        {
            set { tourServices = value; }
        }

        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {
            // asignar los servicios al control
            tbAsignarRecursos.Enabled = true;
            tbAsignarRecursosDetalle.Enabled = false;
            tbAsignarGuias.Enabled = false;
            tbAsignarTraslados.Enabled = false;

            UCAsignarRecursos.TourServices = this.tourServices;
            UCAsignarRecursosDetalleTour.TourServices = this.tourServices;
            UCAsignarRecursosGuias.TourServices = this.tourServices;
            UCAsignarRecursosTraslados.TourServices = this.tourServices;
            //UCReporteOperaciones1.OperacionesServices = this.operacionesServices;
            //UCReporteOperaciones1.MantenimientoServices = this.mantenimientoServices;       
        }

        public void onVerTour(object sender, GridViewCommandEventArgs e)
        {
            
            tbAsignarRecursos.Enabled = false;
            tbAsignarRecursosDetalle.Enabled = true;
            tbAsignarGuias.Enabled = false;
            tbAsignarTraslados.Enabled = false;
            // cargar el control
            int tour_ID = int.Parse(e.CommandArgument.ToString());
            UCAsignarRecursosDetalleTour.activeControlSolicitudesGuias(tour_ID);
        }

        public void onAsignarGuiasClick(object sender, GridViewCommandEventArgs e)
        {
            tbAsignarRecursos.Enabled = false;
            tbAsignarRecursosDetalle.Enabled = false;
            tbAsignarGuias.Enabled = true;
            tbAsignarTraslados.Enabled = false;


            // cargar el control de asignar guias
            int recursoSolicitado_ID = int.Parse(e.CommandArgument.ToString());
            UCAsignarRecursosGuias.activeControl(recursoSolicitado_ID);
        }

        public void onAsignarTrasladosClick(object sender, GridViewCommandEventArgs e)
        {
            tbAsignarRecursos.Enabled = false;
            tbAsignarRecursosDetalle.Enabled = false;
            tbAsignarGuias.Enabled = false;
            tbAsignarTraslados.Enabled = true;

            // cargar el control de asignar guias
            int recursoSolicitado_ID = int.Parse(e.CommandArgument.ToString());
            UCAsignarRecursosTraslados.activeControl(recursoSolicitado_ID);
        }

        public void onSamePageRecursosGuias(int recursoSolicitadosId)
        {
            
            tbAsignarRecursos.Enabled = false;
            tbAsignarRecursosDetalle.Enabled = false;
            tbAsignarGuias.Enabled = true;
            tbAsignarTraslados.Enabled = false;

            // cargar el control de asignar guias
            UCAsignarRecursosGuias.activeControl(recursoSolicitadosId);
        }

        public void onSamePageRecursosTraslados(int recursoSolicitadosId)
        {
            tbAsignarRecursos.Enabled = false;
            tbAsignarRecursosDetalle.Enabled = false;
            tbAsignarGuias.Enabled = false;
            tbAsignarTraslados.Enabled = true;

            UCAsignarRecursosTraslados.activeControl(recursoSolicitadosId);

        }
    }
}